#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    char arr[100] = { 0 };
    int i = 0, count1 = 0, count2 = 0;
    gets(arr);
    int len = sizeof(arr);
    for (i = 0; i < len; i++)
    {
        if (arr[i] == 'A')
            count1++;
        if (arr[i] == 'B')
            count2++;
        if (arr[i] == '0')
            break;
    }
    if (count1 > count2)
        printf("%c", 'A');
    else if (count1 < count2)
        printf("%c", 'B');
    else
        printf("%c", 'E');
    return 0;
}